﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UWarrantyCardExEdit : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get { return "UWarrantyCardExList"; }
        }

        #region
        /// <summary>
        /// 需要修改的ID
        /// </summary>
        protected int UWCID
        {
            get
            {
                return GetRequestValue<int>("UWCID");
            }
        }

        private UWarrantyCardInfo _obj;
        protected UWarrantyCardInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = UWarrantyCardController.GetByUWCID(UWCID);
                return _obj;
                //OMenuController.ge
            }
        }
        private UWarrantyCardExInfo _obj2;
        protected UWarrantyCardExInfo obj2
        {
            get
            {
                if (_obj2 == null)
                    _obj2 = UWarrantyCardExController.GetByUWCID(UWCID);
                return _obj2;
                //OMenuController.ge
            }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "edit")
            {
                addmenu();
            }
        }
        protected void addmenu()
        {
            //UWarrantyCardInfo objUWC = Request.SerializableObject<UWarrantyCardInfo>();
            //obj.CustomerAddress = objUWC.CustomerAddress;
            //obj.CustomerMobile = objUWC.CustomerMobile;
            //obj.CustomerName = objUWC.CustomerName;
            //obj.CustomerTel = objUWC.CustomerTel;

          

           // bool x=UWarrantyCardController.Update(objUWC,);
            UWarrantyCardExInfo objUWCE = Request.SerializableObject<UWarrantyCardExInfo>();
            bool  x=UWarrantyCardExController.Update(objUWCE);
            if(x)
                SuccessJson("成功修改通信录信息", DWZRef);
            else
                ErrorJson("修改通信录信息失败", DWZRef);
           



        }

    }
}